package mmc.action;

import static org.lwjgl.input.Keyboard.KEY_UP;
import mmc.Client;
import mmc.Player;
import mmc.networking.ViewDistanceChanged;

public class BiggerViewRange extends InterfaceAction {

	public BiggerViewRange() {
		this("BiggerViewRange", null, KEY_UP);
	}

	public BiggerViewRange(String name, String textureName, int key) {
		super(name, textureName, key);
	}

	@Override
	public void performOnClient() {
		Player player = Client.client.getScene().player;
		player.viewDistance*=1.2;
		
		Client.client.getScene().getContext().post(new ViewDistanceChanged(player.viewDistance));
		player.whisper("viewDistance changed to "+player.viewDistance, player.getName());
	}
}
